Telegram Group & Telegram Channel
В Python сортировка по умолчанию является стабильной, то есть сохраняет порядок равных элементов:


a = [2, -1, 0, 1, -2]
sorted(a, key=lambda x: x**2)
# [0, -1, 1, 2, -2]


Функции max и min тоже стараются быть согласованными с поведением sorted.
max работает аналогично sorted(a, reverse=True)[0], а min — как sorted(a)[0].
Это означает, что обе функции возвращают самый левый возможный результат:


max([2, -2], key=lambda x: x**2)
# 2

max([-2, 2], key=lambda x: x**2)
# -2

min([2, -2], key=lambda x: x**2)
# 2

min([-2, 2], key=lambda x: x**2)
# -2


👉@BookPython



tg-me.com/BookPython/3665
Create:
Last Update:

В Python сортировка по умолчанию является стабильной, то есть сохраняет порядок равных элементов:


a = [2, -1, 0, 1, -2]
sorted(a, key=lambda x: x**2)
# [0, -1, 1, 2, -2]


Функции max и min тоже стараются быть согласованными с поведением sorted.
max работает аналогично sorted(a, reverse=True)[0], а min — как sorted(a)[0].
Это означает, что обе функции возвращают самый левый возможный результат:


max([2, -2], key=lambda x: x**2)
# 2

max([-2, 2], key=lambda x: x**2)
# -2

min([2, -2], key=lambda x: x**2)
# 2

min([-2, 2], key=lambda x: x**2)
# -2


👉@BookPython

BY Библиотека Python разработчика | Книги по питону


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/BookPython/3665

View MORE
Open in Telegram


Библиотека Python разработчика | Книги по питону Telegram | DID YOU KNOW?

Date: |

Look for Channels Online

You guessed it – the internet is your friend. A good place to start looking for Telegram channels is Reddit. This is one of the biggest sites on the internet, with millions of communities, including those from Telegram.Then, you can search one of the many dedicated websites for Telegram channel searching. One of them is telegram-group.com. This website has many categories and a really simple user interface. Another great site is telegram channels.me. It has even more channels than the previous one, and an even better user experience.These are just some of the many available websites. You can look them up online if you’re not satisfied with these two. All of these sites list only public channels. If you want to join a private channel, you’ll have to ask one of its members to invite you.

Библиотека Python разработчика | Книги по питону from jp


Telegram Библиотека Python разработчика | Книги по питону
FROM USA